Are you working with SAPUI5 connected to a NW Gateway using OData?
If so, why don't you schedule a report in the backend which will purge all locks which have not been "kept alive" for x minutes?
This would of course imply that you keep your locks alive by regularly sending some request to the backend as long as the form is used in the frontend.
That's the way I'm currently trying to implement object locking. I haven't gone deep into it yet but what I'm not sure about is how can I actively release a lock if a view is left by let's say using the browser's back button??
Any idea?