The provisions of this subchapter restricting the possession and having control of narcotic drugs shall not apply to common carriers or to warehousemen, while engaged in lawfully transporting or storing such drugs, or to any employee of the same acting within the scope of his employment; or to public officers or their employees in the performance of their official duties requiring possession or control of narcotic drugs; or to temporary incidental possession by employees or agents of persons lawfully entitled to possession, or by persons whose possession is for the purpose of aiding public officers in performing their official duties.