[api] Do not create a PID file unless explicitely told to

@AvianFlu please review