Fixed the case of loan getting into unloanable state when a waiting loan is expired.

Fixed it by updating the checkedout status and position in the WL for
each entry after marking a loan as expired.