Improve edit locks

Use the WP heartbeat API to ensure that users are constantly connected. If
more than 4 pings are missed (default 60 seconds), then the user is assumed
to have closed the browser, and the edit lock is lifted.