The neglect or refusal of any sheriff, constable, peace officer or jail warden to execute any process, to make proper return of all fines and penalties collected or to receive into custody any prisoner shall be deemed a misdemeanor and shall subject the offender to a prosecution by the proper district attorney and to a penalty, upon conviction of each such offense, of $1,000 to the use of the Commonwealth.