Include lending status in availability code check, refs #1618