Court orders police to discharge Ugandan author