Delete pid file in a finally block

To address #147