A Real-Time Closed-Loop EEG-Based Brain–Computer Interface for Robotic Arm Control via Motor Imagery