Update __init__.py

Cleanup running instance checking and pid locking to handle more edge cases.