Added a timeout to release inactive connections.