The suspect pleaded guilty to locking an agent inside a detached garage while she was showing him a home