Mode-locking optimization with a real-time feedback system in a Nd:yttrium lithium fluoride laser cavity