Memory Management for Real-Time Appearance-Based Loop Closure Detection